if (!(outFile.exists() || febeIsDrive(subDirs[i]))) {
outFile.create(Ci.nsIFile.DIRECTORY_TYPE, 0755);
}
}
if(!zEntry.isDirectory){
outFile.append(subDirs[end]);
zipR.extract(entry,outFile);
}
}//while
return true;
}//febeUnzip()
function febeIsDrive(path){
// Is path a drive disignator? ("C:", etc)
if(path.match(":")) return true
return false;
}//febeIsDrive()
function febeAddToZip(sourceNames,destDir,zipName){
// Zip the files listed in sourceNames array into destDir as zipName - sourceNames contains full pathnames of files only. Directories are ignored, zipName is overwriten
// Initialize
//var root = src = sourceDir;
var zipW;
const PR_RDONLY = 0x01
const PR_WRONLY = 0x02
const PR_RDWR = 0x04
const PR_CREATE_FILE = 0x08
const PR_APPEND = 0x10
const PR_TRUNCATE = 0x20
const PR_SYNC = 0x40
const PR_EXCL = 0x80
const COMPRESSION_NONE = 0;
const COMPRESSION_FASTEST = 1;
const COMPRESSION_DEFAULT = 6;
const COMPRESSION_BEST = 9;
var ZipWriter = Components.Constructor("@mozilla.org/zipwriter;1",
"nsIZipWriter");
var ZipReader = Components.Constructor("@mozilla.org/libjar/zip-reader;1",
"nsIZipReader", "open");
// Init routine
var init = function (destDir,zipName){
febeZipFinished = false; // Set to 'true' when zipping is completed
var zipFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);